home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
programs
/
write
/
rexx
/
oberonerror.wrx
< prev
Wrap
Text File
|
1996-09-18
|
3KB
|
152 lines
/*
* REXX-SCRIPT für WRITE 5.0
* Dies Script unterstützt den Umgang mit dem
* Amiga Oberon Compiler 3.0 von A+L.
* Dieses Script mit den Parametern FIRST, CURRENT, PREV, NEXT oder LIST aus
* dem aktuellen Text heraus starten.
*
*
* $VER: oberonerror.wrx 1.2 (27-5-96)
*
* History:
*
* 1.2 Addepted to WRITE 5.0
* 1.1 fixed bug with filenames ending in uppercase forms of ".mod"
* transformed " !" to "!" [TT]
* 1.0 initial Version
*
*/
IF ~show('P',"WRITE")
THEN DO
say 'Dieses Script läuft nur, wenn WRITE bereits gestartet wurde!'
exit 10
END
ADDRESS "WRITE"
OPTIONS RESULTS
/*** Argumentkontrolle ***/
arg what
if (what ~= "FIRST") & (what ~= "NEXT") & (what ~= "CURRENT") & (what ~= "PREV") & (what~="LIST") then do
'MessageOk("Fehler:\nDieses Script muß mit FIRST, CURRENT, PREV oder LIST\nals Argument aufgerufen werden !")'
exit
end
/*** Open oberonsupport.library ***/
libname = "oberonsupport.library"
if ~show("L", libname) then do
if ~addlib(libname, 0, -30, 1) then do
text = "Fehler :\n'" || libname "'\nkonnte nicht gefunden werden"
'MessageOk(&text)'
end
end
/*** Filenamen holen ***/
'&filename:=_fileName' /* Kompletten Filenamen (mit Pfad) holen */
suffix = right(filename,4)
upper suffix
if suffix ~= ".MOD" then do
"Message(`Fehler:\n'` | FilePart(_fileName)| `'\nist kein Oberon Sourcecode!`)"
exit
end
filename = filename || 'E'
/*** Enthält Fehler ? ***/
count = GETERRCOUNT(filename)
if count < 0 then do
"MessageOk(`'` | FilePart(_fileName) | `'\nenthält keine Fehler`)"
exit
end
cnt = getclip("CurrentError")
if cnt = "" then do
cnt = 0
end
if what = "LIST" then do
ShowErrorList()
end
if what = "FIRST" then do
cnt = 0
end;
if what = "NEXT" then do
cnt = cnt+1
end;
if what = "PREV" then do
cnt = cnt-1
end
if cnt >= count then do
"Message(`'` | FilePart(_fileName) | `'\nenthält keine Fehler`)"
exit
end
if cnt < 0 then do
'MessageOk("Erster Fehler\nbereits erreicht!")'
exit
end
if ~GETERROR(filename, cnt, Error.) then do
'MessageOk("Fehler:\nKann Fehlerdatei nicht laden!")'
exit
end
'Goto([NUMBER(&Error.column),NUMBER(&Error.line)])'
text = "Fehler Nr." cnt+1 "von" count || ":\n" || "`" || GETERRORTEXT(Error.num) || "'"
'MessageOk(&text)'
if ~setclip("CurrentError",cnt) then do
'MessageOk("Fehler:\nKann mir aktuellen Fehler nicht merken!")'
end
exit 0
ShowErrorList:
'ClearList(0)'
do x = 0 to count-1
if GETERROR(filename, x, Error.) then do
text = x+1 || " " || "`" || GETERRORTEXT(Error.num) || "'"
'AddList(&text,0)'
end
end
'&result:=ShowList(0,&cnt,&text){@SELECT}'
if result then do
if Text~="" then do
Error = Word(Text,1)
cnt = Value(Error) - 1
if ~GETERROR(filename, cnt, Error.) then do
'MessageOk("Fehler:\nKann Fehlerdatei nicht laden!")'
exit
end
'Goto([&Error.column,&Error.line])'
text = "Fehler Nr." cnt+1 "von" count || ":\n" || "`" || GETERRORTEXT(Error.num) || "'"
'MessageOk(&text)'
if ~setclip("CurrentError",cnt) then do
'MessageOk("Fehler:\nKann mir aktuellen Fehler nicht merken!")'
end
end
end
exit 0